package com.aliyun.messagemgt.web.controller;

import com.aliyun.messagemgt.application.service.BaseTenantUserService;
import com.aliyun.messagemgt.common.dto.response.ResultMap;
import com.aliyun.messagemgt.dto.base.BaseReceiveGroupDTO;
import com.aliyun.messagemgt.dto.base.BaseTenantUserDTO;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName: BaseTetantUserController
 * @Description:
 * @Author: wugongzi
 * @Date: 2021/10/12 9:37
 * @Version: 1.0
 */
@RestController
@RequestMapping("/base/tenant/user")
@Api(tags = "租户用户")
public class BaseTenantUserController {

    @Autowired
    private BaseTenantUserService baseTetantUserService;

    @GetMapping
    @ApiOperation("查询租户用户")
    @ApiResponses({
            @ApiResponse(code = 200, message = "列表对象", response = BaseReceiveGroupDTO.class)
    })
    public ResultMap<List<BaseTenantUserDTO>> select(@ApiParam("用户id")@RequestParam("userId") String userId) {
        List<BaseTenantUserDTO> baseTetantUserDTOList = baseTetantUserService.select(userId);
        return new ResultMap<>(baseTetantUserDTOList);
    }
}
